import request from '@/utils/request'

// 终端登录
export function terminalLogin(data = {}) {
	return request({
		url: `/user/terminal/login`,
		method: 'post',
		headers: {
			isToken: false
		},
		data
	})
}

// 用户登录
export function userLogin(data = {}) {
	return request({
		url: `/user/login`,
		method: 'post',
		headers: {
			isToken: false
		},
		data
	})
}

// 用户退出登录
export function userLogout(data = {}) {
	return request({
		url: `/user/logout`,
		method: 'post',
		data
	})
}

// 获取用户信息
export function getUserInfo(data = {}) {
	return request({
		url: '/user/getUserInfo',
		method: 'get',
		data
	})
}

// 会议列表
export function meetingList(data = {}) {
	return request({
		url: `/meetingroom/pageList`,
		method: 'post',
		data
	})
}

// 创建会议室
export function createMeetingRoom(data = {}) {
	return request({
		url: "/meetingroom/create",
		method: 'post',
		data
	})
}

// 加入会议室

export function joinMeetingRoom(data = {}) {
	return request({
		url: "/meetingroom/join",
		method: 'post',
		data
	})
}

// 网络IP摄像头加入会议室
export function getIpCamera(data = {}) {
	return request({
		url: "/meetingroom/getIpCamera",
		method: 'post',
		data
	})
}

// 退出会议室
export function leaveMeetingRoom(data = {}, headers = {}) {
	return request({
		url: "/meetingroom/leave",
		method: 'delete',
		data,
		headers
	})
}

// 开始录制会议
export function startRecording(data = {}) {
	return request({
		url: "/meetingroom/recording/start",
		method: 'post',
		data
	})
}

// 停止录制会议
export function stopRecording(data = {}) {
	return request({
		url: "/meetingroom/recording/stop",
		method: 'post',
		data
	})
}

// 发送聊天消息
export function sendMessage(data = {}) {
	return request({
		url: "/meetingroom/send/signal/chat",
		method: 'post',
		data
	})
}

// 获取websocket事件
export function getWSEvents(data = {}) {
	return request({
		url: "/websocket/eventList",
		method: 'post',
		data
	})
}

// 上传会议室缩略图
export function uploadCover(data = {}) {
	return request({
		url: "/meetingroom/uploadFile/meetingRoomAvatar",
		method: 'post',
		data,
		headers: {
			'content-type': 'multipart/form-data;'
		}
	})
}

// 上传会议室截图
export function shareCapture(data = {}) {
	return request({
		url: "/meetingroom/uploadFile/screenshot",
		method: 'post',
		data,
		headers: {
			'content-type': 'multipart/form-data;'
		}
	})
}

// 查询当前用户所属的用户组列表
export function getUserGroup(data = {}) {
	return request({
		url: "/userGroup/listByCurrentUser",
		method: 'post',
		data
	})
}

// 根据用户组查询用户列表 
export function listByUserGroup(data = {}) {
	return request({
		url: "/user/listByUserGroup",
		method: 'post',
		data
	})
}